#ifndef __ITEM_MANAGER_H__
#define __ITEM_MANAGER_H__

class Item;
class CSVReader;
class ItemManager:public manager<Item,ItemId>,public singleton<ItemManager>
{
public:
	ItemManager();
	virtual ~ItemManager();
	virtual Item* Add(ItemId id);
	virtual bool Remove(ItemId id);
	void loadItemCSV();
	Item* CreateFromItemInfo(ItemInfo& info);
	Item* CreateFromCSVId(Int32 csv_id);

	ItemCSVInfo* GetItemCSVInfo(Int32 csv_id);
private:
	void GenerateItemInfo(ItemCSVInfo& csv_info,ItemInfo &info);
	Int32 GetValueMaxMinBetween(Int32 nMax, Int32 nMin);
private:
	CSVReader m_csvReader;

	std::map<Int32,ItemCSVInfo> m_mapItemCSV;
};
#endif
